package com.tianji.learning.controller;


import com.tianji.learning.domain.vo.SignResultVO;
import com.tianji.learning.service.ISignRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 签到记录表 前端控制器
 * </p>
 *
 * @author ffk
 * @since 2024-06-29
 */
@Api(tags = "签到相关接口")
@RestController
@RequiredArgsConstructor
@RequestMapping("/sign-records")
public class SignRecordController {

    private  final ISignRecordService signRecordService;

    /**
     * 签到
     * @return 返回连续签到的天数以及获得的积分
     */
    @ApiOperation("签到")
    @PostMapping
    public SignResultVO makeSignRecord() {
      return   signRecordService.makeSignRecord();
    }

    /**
     * 查询签到记录
     * @return 本月签到记录，01字符串
     */
    @GetMapping
    public Byte[] getSignRecords() {
        return signRecordService.getSignDays();
    }
}
